from django.contrib.auth.decorators import login_required
from django.urls import path
from .views import depts_view, menus_view, roles_view, jobs_view

# 2.x后必须指定app_name
app_name = 'config'

urlpatterns = [
    path('menus_view/', login_required(menus_view.menus_view), name='menus_view'),
    path('menus_lists/', login_required(menus_view.menus_lists), name='menus_lists'),
    path('menus_list/', login_required(menus_view.menus_list), name='menus_list'),  # 登陆后根据角色生成左边菜单
    path('menus_list1/', login_required(menus_view.menus_list1), name='menus_list1'),  # 后台管理中需要的
    path('menus_insert_view/', login_required(menus_view.menus_insert_view), name='menus_insert_view'),
    path('menus_list2/', login_required(menus_view.menus_list2), name='menus_list2'),
    path('menus_insert/', login_required(menus_view.menus_insert), name='menus_insert'),
    path('menus_edit_view/', login_required(menus_view.menus_edit_view), name='menus_edit_view'),
    path('menus_edit/<int:id>', login_required(menus_view.menus_edit), name='menus_edit'),
    path('menus_del/<int:id>', login_required(menus_view.menus_del), name='menus_del'),
    # 组织机构
    path('depts_view/', login_required(depts_view.depts_view), name='depts_view'),
    path('depts_list/<int:id>', login_required(depts_view.depts_list), name='depts_list'),
    path('depts_list1/', login_required(depts_view.depts_list1), name='depts_list1'),
    path('depts_list2/', login_required(depts_view.depts_list2), name='depts_list2'),
    path('depts_insert_view/', login_required(depts_view.depts_insert_view), name='depts_insert_view'),
    path('depts_insert/', login_required(depts_view.depts_insert), name='depts_insert'),
    path('depts_edit_view/', login_required(depts_view.depts_edit_view), name='depts_edit_view'),
    path('depts_edit/<int:id>', login_required(depts_view.depts_edit), name='depts_edit'),
    path('depts_del/<int:id>', login_required(depts_view.depts_del), name='depts_del'),
    path('depts_select/', login_required(depts_view.depts_select), name='depts_select'),

    # 角色
    path('roles_view/', login_required(roles_view.roles_view), name='roles_view'),
    path('roles_list/', login_required(roles_view.roles_list), name='roles_list'),
    path('roles_insert_view/', login_required(roles_view.roles_insert_view), name='roles_insert_view'),
    path('roles_insert/', login_required(roles_view.roles_insert), name='roles_insert'),
    path('roles_menus/', login_required(roles_view.roles_menus), name='roles_menus'),
    path('roles_edit_view/', login_required(roles_view.roles_edit_view), name='roles_edit_view'),
    path('roles_edit/<int:id>', login_required(roles_view.roles_edit), name='roles_edit'),
    path('roles_del/<int:id>', login_required(roles_view.roles_del), name='roles_del'),
    path('roles_enable/<int:id>', login_required(roles_view.roles_enable), name='roles_enable'),
    path('roles_search/', login_required(roles_view.roles_search), name='roles_search'),
    # 岗位
    path('jobs_view/', login_required(jobs_view.jobs_view), name='jobs_view'),
    path('jobs_list/', login_required(jobs_view.jobs_list), name='jobs_list'),
    path('jobs_list1/', login_required(jobs_view.jobs_list1), name='jobs_list1'),
    path('jobs_insert_view/', login_required(jobs_view.jobs_insert_view), name='jobs_insert_view'),
    path('jobs_insert/', login_required(jobs_view.jobs_insert), name='jobs_insert'),
    path('jobs_edit_view/', login_required(jobs_view.jobs_edit_view), name='jobs_edit_view'),
    path('jobs_edit/<int:id>', login_required(jobs_view.jobs_edit), name='jobs_edit'),
    path('jobs_del/<int:id>', login_required(jobs_view.jobs_del), name='jobs_del'),
    path('jobs_search/', login_required(jobs_view.jobs_search), name='jobs_search'),

]
